@using k8s.Models
@using BlazorApp.Pages.Common.Metadata
@using BlazorApp.Pages.Event
@using BlazorApp.Pages.Common
@using BlazorApp.Pages.Common.Html.HTable
@using BlazorApp.Pages.Common.Html
@using Entity.Crd.Gateway

@inherits DrawerPageBase<${ItemType}>
@if (${Item} != null)
{
    <${Item}Action Item="${Item}" MenuMode="MenuMode.Horizontal"  ></${Item}Action>
    <Divider Orientation="left" Style="font-weight:bold">@L["Metadata"]</Divider>
    <MetadataView Item="${Item}.Metadata"  ExplainFieldPrefix="${ExplainResourceName}"></MetadataView>
    <Divider Orientation="left" Style="font-weight:bold">@L["Spec"]</Divider>
    <HTable Bordered Column="1">
        $for(i in Properties)
            ${if(i.IsStatus==false)}
                ${if(i.isList)}
                    ${if(i.MultipleChildItem)}
                <PropertySimpleView Title="$i.Name" Item="@$i.FullName" ExplainField="$i.ExplainFiled" ShowInJson="true"></PropertySimpleView>
                    ${else}
                        ${if(i.OnlyOneChildItemName==null)}
                <PropertySimpleView Title="$i.Name" Item="@$i.FullName" ExplainField="$i.ExplainFiled" ShowInJson="true"></PropertySimpleView>
                        ${else}
                <PropertyListView Title="$i.Name" Items="@$i.FullName" ExplainField="$i.ExplainFiled"  Key="$i.OnlyOneChildItemName"  T="$i.CoreType"></PropertyListView>
                        ${end}
                    ${end}
                ${else}
                <PropertySimpleView Title="$i.Name" Item="@$i.FullName" ExplainField="$i.ExplainFiled" ${if(i.ShowInJson)} ShowInJson="true" ${end}></PropertySimpleView>
                ${end}
            ${end}
        ${end}
    </HTable>
 <Divider Orientation="left" Style="font-weight:bold">@L["Status"]</Divider>
    <HTable Bordered Column="1">
    $for(i in Properties)
            ${if(i.IsStatus==true)}
                ${if(i.isList)}
                    ${if(i.MultipleChildItem)}
                <PropertySimpleView Title="$i.Name" Item="@$i.FullName" ExplainField="$i.ExplainFiled" ShowInJson="true"></PropertySimpleView>
                    ${else}
                        ${if(i.OnlyOneChildItemName==null)}
                <PropertySimpleView Title="$i.Name" Item="@$i.FullName" ExplainField="$i.ExplainFiled" ShowInJson="true"></PropertySimpleView>
                        ${else}
                <PropertyListView Title="$i.Name" Items="@$i.FullName" ExplainField="$i.ExplainFiled"  Key="$i.OnlyOneChildItemName"  T="$i.CoreType"></PropertyListView>
                        ${end}
                    ${end}
                ${else}

                <PropertySimpleView Title="$i.Name" Item="@$i.FullName" ExplainField="$i.ExplainFiled" ${if(i.ShowInJson)} ShowInJson="true" ${end}></PropertySimpleView>
                ${end}
            ${end}
        ${end}
    </HTable>

    <MiniEventListView Uid="@${Item}.Metadata.Uid"></MiniEventListView>
}
